import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import Axios from 'axios'
import jquery from 'jquery'

import {setupAntd} from './plugs/ant-design-vue/index'
import 'animate.css';


Axios.defaults.baseURL="http://127.0.0.1:8888"
//Axios.defaults.baseURL="http://127.0.0.1:8888"
// Axios.defaults.baseURL="http://127.0.0.1:8888"
// 添加请求拦截器
Axios.interceptors.request.use(function (config) {
    // 在发送请求之前做些什么
    // 判断是否存在token,如果存在将每个页面header添加token
    if (sessionStorage.getItem("access-token")) {
      config.headers.common['access-token'] = sessionStorage.getItem("access-token");
    }
    return config
  }, function (error) {
    router.push('/')
    return Promise.reject(error)
  })



const app=createApp(App)
setupAntd(app)
app.config.globalProperties.$axios=Axios
app.use(store).use(router).use(jquery).mount('#app')
